
import { request } from '@/utils/request';


import { BaseModel } from '@/api/common/baseModel'

export interface Model extends BaseModel {
  remark: string
  payNotifyUrl: string
  refundNotifyUrl: string
  merchantId: string
  merchantName: string
  createTime: Date
}

export interface AppPageReqVO {
  name?: string
  status?: number
  remark?: string
  payNotifyUrl?: string
  refundNotifyUrl?: string
  merchantName?: string
  createTime?: Date[]
}

export interface AppExportReqVO extends BaseModel {
  status?: number
  remark?: string
  payNotifyUrl?: string
  refundNotifyUrl?: string
  merchantName?: string
  createTime?: Date[]
}

export type AppUpdateStatusReqVO = BaseModel

// 查询列表支付应用
export const getAppPage = (params: AppPageReqVO) => {
  return request.get({ url: '/pay/app/page.json', params })
}

// 查询详情支付应用
export const getById = (id: string) => {
  return request.get({ url: '/pay/app/getById.json?id=' + id })
}

// 修改支付应用
export const update = (data: any, ) => {
  return request.put({ url: '/pay/app/update.json', data })
}

// 支付应用信息状态修改
export const changeAppStatus = (data: AppUpdateStatusReqVO) => {
  return request.put({ url: '/pay/app/update-status', data: data })
}

// 删除支付应用
export const del = (id: string) => {
  return request.delete({ url: '/pay/app/del.json?id=' + id, data: [id, ],  })
}

// 根据商ID称搜 索应用列表
export const getAppListByMerchantId = (merchantId: string) => {
  return request.get({
    url: '/pay/app/list-merchant-id',
    params: { merchantId: merchantId }
  })
}
